home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 1 / Amiga Tools.iso / egs-tools / egs_dev-disk / egsincludes / egsgfx.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-06-06  |  5.1 KB  |  192 lines

  1. #ifndef EGS_EGSGFX_H
  2. #define EGS_EGSGFX_H
  3.  
  4. /***************************************************************************\
  5. *
  6. *  $
  7. *  $ FILE     : egsgfx.h
  8. *  $ VERSION  : 1
  9. *  $ REVISION : 4
  10. *  $ DATE     : 08-Dec-93 12:45
  11. *  $
  12. *  $ Author   : mvk
  13. *  $
  14. *
  15. *****************************************************************************
  16. *                                                                           *
  17. * (c) Copyright 1990/94 VIONA Development                                   *
  18. *     All Rights Reserved                                                   *
  19. *                                                                           *
  20. \***************************************************************************/
  21.  
  22. #ifndef         EXEC_TYPES_H
  23. #include        <exec/types.h>
  24. #endif
  25. #ifndef         EXEC_PORTS_H
  26. #include        <exec/ports.h>
  27. #endif
  28. #ifndef         EXEC_LISTS_H
  29. #include        <exec/lists.h>
  30. #endif
  31. #ifndef         EXEC_SEMAPHORES_H
  32. #include        <exec/semaphores.h>
  33. #endif
  34. #ifndef         GRAPHICS_TEXT_H
  35. #include        <graphics/text.h>
  36. #endif
  37. #ifndef         EGS_EGS_H
  38. #include        <egs/egs.h>
  39. #endif
  40. #ifndef         EGS_EGSBLIT_H
  41. #include        <egs/egsblit.h>
  42. #endif
  43. #ifndef         EGS_EGSLAYERS_H
  44. #include        <egs/egslayers.h>
  45. #endif
  46.  
  47.  
  48. /*
  49.  * This library uses "egslayers.library" and "egsblit.library".  It
  50.  * standardizes the access to layers and BitMaps and makes their usage easier.
  51.  *
  52.  * The functions resemble in a great part those of the "graphics.library".
  53.  * The basic structure is the RastPort which contains a layer, a BitMap
  54.  * and/or a screen. All conventions are abided by (MouseOn..MouseOff,
  55.  * LockLayer..UnlockLayer).  You can clip with a layer and/or a region, just
  56.  * as you like.
  57.  *
  58.  */
  59.  
  60. /*
  61.  * DrawModes
  62.  *
  63.  * States that define the color distribution for drawing operations.
  64.  *
  65.  *   DRAW_APEN  : You draw with the APen on transparent background.
  66.  *   DRAW_ABPEN : You draw with the APen in front and the BPen for the
  67.  *                 background.
  68.  *   INVERT     : You draw in inverting mode.
  69.  *
  70.  */
  71.  
  72. /* Enumeration type DrawMode has 8 bits ! */
  73.  
  74. #define EG_DRAW_APEN  0
  75. #define EG_DRAW_ABPEN 1
  76. #define EG_INVERT     2
  77.  
  78. /*
  79.  * EFont, EFontPtr
  80.  *
  81.  * Extension of the Amiga TextFont structure with additional information.
  82.  * Created by "EG_OpenFont" and destroyed by "EG_CloseFont".
  83.  *
  84.  */
  85.  
  86. typedef struct EG_EFont *EG_EFontPtr;
  87.  
  88. struct EG_EFont {
  89.         struct TextFont  *Font;
  90.         struct E_EBitMap  EMap;
  91. };
  92.  
  93. /*
  94.  * PolyEntry, Polygon, PolyPtr
  95.  *
  96.  * Structures for polygons.
  97.  */
  98.  
  99. struct EG_PolyEntry {
  100.                         WORD X, Y;
  101. };
  102.  
  103. typedef struct EG_PolyEntry  EG_Polygon;
  104. typedef struct EG_PolyEntry *EG_PolyPtr;
  105.  
  106. /*
  107.  * AreaInfo, AreaInfoPtr
  108.  *
  109.  * Structure for Area commands, initialized by "EG_InitArea".
  110.  *
  111.  */
  112.  
  113. typedef struct EG_AreaInfo *EG_AreaInfoPtr;
  114.  
  115. struct EG_AreaInfo {
  116.  
  117.         EG_PolyPtr  VctrTbl, VctrPtr, VctrLast;
  118.         WORD        Count, MaxCount;
  119. };
  120.  
  121.  
  122.  
  123. /*
  124.  * RastPort, RastPortPtr...
  125.  *
  126.  * Basic EGSGfx drawing structure:
  127.  *
  128.  *  .BitMap  : BitMap drawn into.
  129.  *  .Layer   : Layer drawn into.
  130.  *  .Screen  : Screen drawn into.
  131.  *
  132.  *  .cp_x,
  133.  *     cp_y  : Current drawing cursor, can be changed by "EG_Move" or direct
  134.  *             access.
  135.  *  .am_x,
  136.  *     .am_y : Current area cursor, must be changed by "EG_AreaMove".
  137.  *
  138.  *  .APen    : APen i.e. front pen.
  139.  *  .BPen    : BPen i.e. pen for background.
  140.  *
  141.  *  .Mode    : Drawing mode (see above).
  142.  *  .Font    : Current text font, can be changed by "EG_SetFont" or direct access.
  143.  *
  144.  *  .Region  : ClipRegion, must be changed by "EG_InstallClipRegion" or
  145.  *             "EG_RemoveClipRegion".
  146.  *  .FClip,
  147.  *  .BClip   : PRIVATE !
  148.  *
  149.  *  .CurvStep: Bezier curves are split up into small lines. This value
  150.  *             specifies the maximum length of such line segments.
  151.  *
  152.  *  .TmpRas  : Pointer to a one-planed BitMap that is to be used for Area
  153.  *             commands. If the BitMap is missing each Area operation
  154.  *             allocates its own BitMap and frees it after processing.
  155.  *
  156.  *  .AreaInfo: AreaInfo structure.
  157.  *
  158.  * For reasons of compatibility no variables of the RastPort type may be
  159.  * used or created. RastPorts can only be created by "EG_CreateRastPort" and
  160.  * destroyed by "EG_DeleteRastPort".
  161.  *
  162.  */
  163.  
  164. typedef struct EG_RastPort *EG_RastPortPtr;
  165.  
  166. struct EG_RastPort {
  167.  
  168.         E_EBitMapPtr    BitMap;
  169.         EL_LayerPtr     Layer;
  170.         E_EScreenPtr    Screen;
  171.         WORD            Depth;
  172.         WORD            cp_x, cp_y, am_x, am_y;     /* Commodore */
  173.         UWORD           Pad_1;
  174.         ULONG           APen, BPen;
  175.         UBYTE           DrawMode;
  176.         UBYTE           Pad_2, Pad_3, Pad_4;
  177.         EG_EFontPtr     Font;
  178.         EB_ClipRectPtr  Region;
  179.         EB_ClipRectPtr  FClip, BClip;
  180.         WORD            CurvStep;
  181.         UWORD           Pad_5;
  182.         E_EBitMapPtr    TmpRas;
  183.         EG_AreaInfoPtr  AreaInfo;
  184.         UBYTE           AlgoStyle;                 /* Font style set has 8 bits */
  185.         UBYTE           Pad_6, Pad_7, Pad_8;
  186.         ULONG           Mask;
  187.         LONG            ClipKey;
  188.         LONG            Flags;                     /* No flags defined yet */
  189. };
  190.  
  191. #endif  /* EGS_EGSGFX_H */
  192.